<?php
if ($_POST) {
    include_once 'rfq_do.php';
    include '../business/rfq_plastic_manager.php';
    include_once '../entity/rfq_plastic_entity.php';

    $rfqPlasticMng = new RFQPlasticMng();
    $rfqPlasticEntity = new RFQPlasticEntity();

    $rfqPlasticEntity->id = "-1";
    $rfqPlasticEntity->rfqID = $rfqID;
    $rfqPlasticEntity->equipment = $_POST['sl_equipment'];
    $rfqPlasticEntity->description = $_POST['txt_description'];
    $rfqPlasticEntity->specification = $_POST['txt_specification'];
    $rfqPlasticEntity->inTime = time();
    $rfqPlasticEntity->inUser = $_SESSION['userID'];

    if ($rfqPlasticMng->update($rfqPlasticEntity)) {
        echo "<script>window.location.href='rfq_submit.php'</script>";
    }

} else {
    include 'common/smarty.php';

    $tpl->display('rfq_plastic.html');
}
?>
